package test11;

/**
 * Created by tianxiadiyishuai on 2017/10/25.
 */
public class Rectangle {
    double length;
    double width;

    public Rectangle(double length, double width) {
        this.length = length;
        this.width = width;
    }

    public String getTangle() {
        return "该矩形：\n" + "长为：" + this.length + ";宽为：" + this.width;
    }

    public String getArea() {
        return "面积为：" + (this.length * this.width);
    }

    public String getGirth() {
        return "周长为：" + 2 * (this.length + this.width);
    }

    public void printMyWay() {
        System.out.println(this.getTangle());
        System.out.println(this.getArea());
        System.out.println(this.getGirth());
    }
}
